package com.nulldev.util.security.hashAPI.impls.keccak.impl;

public class SHAKE extends Keccak {
	public SHAKE(int digestSizeBits) {
		super(digestSizeBits);
	}

	public SHAKE(SHAKE other) {
		super(other);
	}

	@Override
	public String toString() {
		return "SHAKE" + digestSizeBits;
	}

	@Override
	protected void pad() {
		updateBits(0x0f, 4);
		super.pad();
	}

	@Override
	protected int rateSizeBitsFor(int digestSizeBits) {
		switch (digestSizeBits) {
			case 128:
				return 1344;
			case 256:
				return 1088;
			default:
				throw new IllegalArgumentException("Invalid digestSizeBits: " + digestSizeBits + " E { 128, 256 }");
		}
	}
}